package com.superb.system.api.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.superb.common.core.annotation.SuperbEncryptDecrypt;
import com.superb.common.core.annotation.SuperbEncryptDecryptField;
import com.superb.common.core.enums.EncryptType;
import com.superb.common.database.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 系统租户管理表
 * @Author: ajie
 * @CreateTime: 2024-5-11
 */
@Data
@SuperbEncryptDecrypt
@TableName("system_tenant")
@Tag(name = "系统租户管理表")
@EqualsAndHashCode(callSuper=false)
public class SystemTenant extends BaseEntity {

    @NotBlank(message = "租户id标识不能为空")
    @Schema(description = "租户id标识", requiredMode = Schema.RequiredMode.REQUIRED)
    private String tenantKey;

    @NotBlank(message = "租户名称不能为空")
    @Schema(description = "租户名称", requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;

    @Schema(description = "租户logo")
    private String logo;

    @Schema(description = "法人")
    private String legalPerson;

    @Schema(description = "联系电话")
    @SuperbEncryptDecryptField(encrypt = false, type = EncryptType.PHONE)
    private String phone;

    @Schema(description = "身份证号")
    @SuperbEncryptDecryptField(encrypt = false, type = EncryptType.IDCARD)
    private String idcard;

    @Schema(description = "银行卡号")
    @SuperbEncryptDecryptField(encrypt = false, type = EncryptType.BANKCARD)
    private String bankNo;

    @Schema(description = "开户行")
    private String bank;

    @Schema(description = "统一信用代码")
    @SuperbEncryptDecryptField(encrypt = false, type = EncryptType.CREDITCODE)
    private String creditCode;

    @Schema(description = "企业注册地址")
    @SuperbEncryptDecryptField(encrypt = false, type = EncryptType.ADDRESS)
    private String registeredAddress;

    @Schema(description = "营业执照")
    private String businessImage;

    @Schema(description = "身份证正面")
    private String frontIdcard;

    @Schema(description = "身份证反面")
    private String backIdcard;

    @Schema(title = "租户状态", description = "0启用；1禁用")
    private Integer status;

    @Schema(description = "租户页脚配置")
    private String footer;

    @Schema(hidden = true)
    @TableField(exist = false, fill = FieldFill.DEFAULT)
    private String tenantId;
    @Schema(hidden = true)
    @TableField(exist = false, fill = FieldFill.DEFAULT)
    private String organId;

}